use serde::{Deserialize, Serialize};
use ts_rs::TS;

use super::IndicatorActionWrap;

/// Configuration for the IdcScore computation
#[derive(Serialize, Deserialize, Default, Debug, TS, Clone, Copy)]
#[ts(export)]
pub struct IdcScoreConfig {
    /// macd indicator weight
    pub macd_weight: u8,
    /// rsi indicator weight
    pub rsi_weight: u8,
    /// kdj indicator weight
    pub kdj_weight: u8,
    /// boll indicator weight
    pub boll_weight: u8,
    /// cmf indicator weight
    pub cmf_weight: u8,
    /// kvo indicator weight
    pub kvo_weight: u8,
    /// sar indicator weight
    pub sar_weight: u8,
    /// trix indicator weight
    pub trix_weight: u8,
}

/// 最终所有指标的总分后买卖的建议
#[derive(Debug, Serialize, Deserialize, Default, TS, Clone)]
#[ts(export)]
pub struct IdcScore {
    /// 根据所有指标信号及相应值得情况，按照权重计算后总分数的最终买卖不的建议
    pub signal: IndicatorActionWrap,
    /// 根据所有指标的信号及相应值得情况，按照权重计算后总分数
    pub score: f64,
}
